function example(){
  let x : string | number | boolean

  x = Math.random()<0.5
  //let x : boolean
  console.log(x);
  
  if (Math.random()<0.5) {
    x = 'hello'
    //x :string
  }else{
    x = 100
    // x : number
    console.log(x);
  }
  return x
}

let x1 = example()
x1 = 'hello'
x1 = 100
x1 = true